package cn.net.xinyi.xs.util;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class NetUtil {

	// Զ�̷������Ƿ��pingͨ
	public static boolean isServerValid(String url, int timeout) {
		boolean flag = false;
		try {
			InetAddress address = InetAddress.getByName(url);
			flag = address.isReachable(timeout);
		} catch (UnknownHostException e) {
			return flag;
		} catch (IOException e) {
			return flag;
		}
		return flag;
	}
}
